<template>
<button @click="showInfor">点击按钮更换图片</button>
<img :src="url" >
<input type="text" @keydown="showInfor1">
</template>
<script setup>
   import {ref,reactive,toRef} from "vue";
let url= ref(new URL("../assets/image1.png",import.meta.url).href);
const showInfor=()=>{
    url.value = new URL("../assets/image3.png",import.meta.url).href;
 console.log("欢迎来到Vue3世界")
}
const showInfor1=()=>{
    alert("按下按钮");
}
</script>
<style scoped>

</style>